﻿using System.Windows;

namespace RobotGerchik.Views
{
    /// <summary>
    /// Логика взаимодействия для Connect.xaml
    /// </summary>
    public partial class Connect : Window
    {

        public Connect()
        {
            InitializeComponent();

            txbxIPadress.Text = Properties.Settings.Default.IPadress;
            txbxPort.Text = Properties.Settings.Default.Port;
        }

        private void btnConnect_Click(object sender, RoutedEventArgs e)
        {
            Properties.Settings.Default.IPadress = txbxIPadress.Text;
            Properties.Settings.Default.Port = txbxPort.Text;

            RobotGerchik.MainWindow.Login = txbxLogin.Text;
            RobotGerchik.MainWindow.Password = txbxPassword.Password;
            Properties.Settings.Default.Save();
            this.DialogResult = true;
            this.Close();
        }

        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            //dialogResult = false;
        }

        //================================================================================
    
    }
}
